package org.wyy.vm.service.impl;

import org.wyy.vm.dao.IUserDao;
import org.wyy.vm.dao.impl.UserDaoImpl;
import org.wyy.vm.entity.User;
import org.wyy.vm.service.IUserService;

/**
 * @author w
 *
 */
public class UserServiceImpl implements IUserService {
	
	private IUserDao userDao = new UserDaoImpl();

	@Override
	public boolean login(String name, String pwd) {
		
		User user = userDao.getByName(name);
		
		if(user == null) {
			return false;
		}
		
		return user.getPassword().equals(pwd);
	}

	@Override
	public void reg(User user) {
		userDao.add(user);
	}

}
